<?php $this->pageTitle=Yii::app()->name; ?>

<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>

<?php if(!Yii::app()->user->isGuest):?>
<p>
You last logged in on <?php echo date( 'l, F d, Y, g:i a',Yii::app()->user->lastLoginTime ); ?>.
</p>

<?php endif;?>
<p>Congratulations! You have successfully created your Yii application.</p>

<p>You may change the content of this page by modifying the following two files:</p>
<ul>
	<li>View file: <tt><?php echo __FILE__; ?></tt></li>
	<li>Layout file: <tt><?php echo $this->getLayoutFile('main'); ?></tt></li>
</ul>

<p>For more details on how to further develop this application, please read
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
should you have any questions.</p>
<?
	// var_dump(Yii::app()->db);
	// $project = Project::model()->findByPk(2);
	// echo $project['id'];
	// echo "<hr />";

?>
<?php
// var_dump(Yii::app()->user);echo "<br />";
// var_dump(Yii::app()->user->isGuest);echo "<br />";
// var_dump(Yii::app()->user->isInitialized);echo "<br />";
// var_dump(Yii::app()->user->guestName);echo "<br />";
// Yii::app()->user->name = "demosss";
// Yii::app()->user->id = "demo";
var_dump(Yii::app()->user->Id);echo "<br />";

var_dump(Yii::app()->user->name);echo "<br />";
if(isset(Yii::app()->user->Id)) {
echo Yii::app()->user->lastLoginTime."Time<br />";
var_dump(Yii::app()->user->password);

$user=User::model()->findByPk(1);

$time = strtotime("now");
echo "<br /> Test StrtoTime now() ".$time;
echo "<br />".date("d/m/y h:i:s", time())."<br />";
var_dump(strtotime($user->last_login_time)); echo "->user->last_login_time<br />";
var_dump(Yii::app()->user->lastLoginTime); echo "Yii::app()->user->lastLoginTime<br />";
var_dump($user->last_login_time); echo "<br />";
var_dump(date("d/m/y h:i:s", Yii::app()->user->lastLoginTime));

}


		// $model = User::model()->findByPk(1);
		// echo "<br />".$model->username."<br />";
		// // $model->last_login_time = time();
		// $model->email = "timeemail@gmail.com";
		// $model->password_repeat = "abc";
		// $model->password = "abc";
		// $model->id =4;
		// if($model->save())
			// echo "<hr /> He He</hr >";
		// print_r($model->attributes);

echo "<br />";
// The two above returns the same result
// // echo "<hr />";
// echo $userObjs = get_class(Yii::app()->user); echo "<br />";
// $hacks = get_class_methods($userObjs);
// foreach ($hacks as $hack=>$value) {
	// echo $hack." / " .$value."<br />";
// }
// echo "<hr /><hr />";
// $hacks = get_object_vars(Yii::app()->user);
// foreach ($hacks as $hack=>$value) {
	// echo $hack." / " .$value."<br />";
// }
// echo "<br />";
// var_dump(property_exists('CWebUser', 'name'));
// var_dump($_SESSION);
var_dump(Yii::app()->authManager);

?>